using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

using miciv;

namespace micivCore.Data.UnitTechniques
{
    public class AttackTechnique : UnitTechniqueBase
    {
        protected string m_strType;
        protected float m_fSpeed;
        protected float m_fPower;
        protected uint m_uMinRange;
        protected uint m_uMaxRange;

        public AttackTechnique(CoreContext _coreContext, XmlElement _xmlTechnique)
            : base(_coreContext, _xmlTechnique)
        {
            CoreManager coreManager = this.m_coreContext.CoreManager;
            this.m_strType = _xmlTechnique.Attributes["type"].Value;
            this.m_fSpeed = float.Parse(coreManager.GetXmlAttributeValue(_xmlTechnique, "speed", "1.0"));
            this.m_fPower = float.Parse(coreManager.GetXmlAttributeValue(_xmlTechnique, "power", "1.0"));
            this.m_uMinRange = uint.Parse(coreManager.GetXmlAttributeValue(_xmlTechnique, "minrange", "1.0"));
            this.m_uMaxRange = uint.Parse(coreManager.GetXmlAttributeValue(_xmlTechnique, "maxrange", "1.0"));
        }

        override public bool Apply(IUnit _unit)
        {
            if (false != base.Apply(_unit))
            {
                return true;
            }
            return false;
        }
    }
}
